<!DOCTYPE html>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta charset="UTF-8">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="google" content="notranslate" />
<title>图表</title>
<link href="ext-6.5.3/build/classic/theme-neptune/resources/theme-neptune-all.css"	rel="stylesheet" type="text/css" />
<link href="ext-6.5.3/build/examples/kitchensink/neptune-en/resources/KitchenSink-all.css"	rel="stylesheet" type="text/css" />
<link href="css/style.css" rel="stylesheet" type="text/css" />

<script src="ext-6.5.3/build/ext-all.js" type="text/javascript"></script>
<script src="ext-6.5.3/build/classic/locale/locale-zh_CN.js" type="text/javascript"></script>
<script	src="ext-6.5.3/build/packages/charts/classic/charts.js"></script>
<!--script src="js/common.js" type="text/javascript"></script-->
<script src="js/main_left.js" type="text/javascript"></script>
<script src="js/main_top.js" type="text/javascript"></script>
<script src="js/model.js" type="text/javascript"></script>
<style>
html, body {
	margin: 0;
	height: 100%;
}
.transform_logo{color:green;}
</style>
<script>
function toastSuccess(message) {
    Ext.toast({
        html: message?message:'操作成功！',
        title: '系统提示',
        width: 200,
        align: 't'
    });
}

function messageAlert(message) {
    Ext.Msg.alert('操作失败,错误原因如下:', message)
}
function ajaxPost(url,para) {
    Ext.getBody().mask("请稍等..."); 
    Ext.Ajax.request({
        url: url,
        params: para,
        success:function(response, opts) {
            console.log(response.responseText)
            var res = Ext.JSON.decode(response.responseText)
            Ext.getBody().unmask()
            if (res.success) {
                messageAlert(res.message)
            } else {
                toastSuccess(res.message)
            }
            //func(response)
        },
        failure: function(response, opts) {
            alert(1)
        }
    });
}
</script>    


<script>
            Ext.Loader.setPath('Hy', 'js/widget/Hy');
            //var d = Ext.create("Hy.Grid",{title: '系统登录'})
            Ext.define('MyApp.view.main.MainController', {
                extend : 'Ext.app.ViewController',

                routes : {
                    ':id1/:id2/:id3/:id4' : 'onHandle',
                    ':id1/:id2/:id3' : 'onHandle',
                    ':id1/:id2' : 'onHandle',
                    ':id' : 'onHandle'
                },

                onHandle : function(id1,id2,id3,id4) {
                    
                    window.urlParameter1 = id1
                    window.urlParameter2 = id2
                    window.urlParameter3 = id3
                    window.urlParameter4 = id4
                    viewMode = window.urlParameter3?(window.urlParameter3=="view"):false
                    searchId = window.urlParameter2
                    Ext.getBody().mask("请稍等");


                    window.moduleId = id1.substring(0,id1.indexOf('%'))

                    Ext.Loader.loadScript({
                        url: 'js/'+id1.replace('%','/')+'.js',
                        scope: this,
                        onLoad: function() {
                            Ext.getBody().unmask()
                            //appPanel.items.items[1].removeAll(true)
                            //appPanel.items.items[1].add(centerItem)
                           
                        }
                    });

                    /*Ext.Ajax.request({
                        url: 'js/'+id1.replace('%','/')+'.js',
                        params: {},
                        success:function(response) {
                            //console.log(response.responseText)
                            
                            Ext.getBody().unmask()
                            //console.log(centerItem)
                            
                            appPanel.items.items[2].removeAll(true)
                            try {
                                eval(response.responseText)
                            } catch(e) {
                                console.log(e)
                                //window.location='login/login.html'
                            }    
                            appPanel.items.items[2].add(centerItem)
                            
                        },
                        failure: function(response, opts) {
                            window.location='login/login.html'
                            //console.log('server-side failure with status code ' + response.status);
                        }
                    });*/
                   
                }
            });

      

            Ext.on("resize", function(){appPanel.updateLayout()}, this);

            Ext.application({
                name: "MyApp",
                listen : {
                    controller : {
                        '#' : {
                            unmatchedroute : 'onUnmatchedRoute'
                        }
                    }
                },

                defaultToken : 'home',
                mainView: 'MyApp.view.main.MainController',
                onUnmatchedRoute : function(hash) {
                    alert(112)
                },

                launch: function() {

                    Ext.tip.QuickTipManager.init();
                    //Ext.EventManager.onWindowResize(function(width,height) {});



                    window.appPanel = Ext.create('Ext.panel.Panel', {
                        title:"图表配置项",
                        layout: 'border',
                        
                      
                        height:'100%',
                        width: '100%',  
                        
                        items:[
                            
                            {
                                        xtype: 'treepanel',
                                        id:'treegrid',
                                        listeners:{
                                            itemmouseenter: function(view, rec, item, index, e, eOpts){

                                                
                                            }
                                        },
                                        viewConfig: {
                                            stripeRows: true,
                                            enableTextSelection: true
                                        },
                                        width: 1900,
                                        height: 770,
                                        reserveScrollbar: true,
                                        useArrows: true,
                                        rootVisible: false,
                                        multiSelect: false,
                                        singleExpand: true,

                                        title:"",
                                        columns: [
                                            {
                                                xtype: 'treecolumn', 
                                                text: '英文属性',
                                                dataIndex: 'optionId',
                                                flex: 2,
                                                sortable: true,
                                                renderer:function(value,metaData,record) {
                                                    return Ext.util.Format.htmlEncode(value)
                                                }
                                            },
                                            {
                                                text: '中文属性',
                                                dataIndex: 'optionName',
                                                flex: 1,
                                                sortable: true,
                                                align: 'center'
                                            },
                                            {
                                                text: '类型',
                                                dataIndex: 'optionType',
                                                flex: 1,
                                                sortable: true,
                                                align: 'center'
                                            },
                                            {
                                                text: '默认值',
                                                dataIndex: 'optionDefault',
                                                flex: 1,
                                                sortable: true,
                                                align: 'center'
                                            },
                                            {
                                                text: '说明',
                                                dataIndex: 'optionDesc',
                                                flex: 6,
                                                sortable: true,
                                                align: 'center',
                                                renderer:function(value,metaData,record) {
                                                    //return Ext.util.Format.htmlEncode(value)
                                                    //console.log(record.data.rawDesc)
                                                    return '<span data-qtip="'+Ext.util.Format.htmlEncode(record.data.rawDesc)+'">'+Ext.util.Format.htmlEncode(value)+'</span>';
                                                }
                                            }
                                        ],


                                        store: {
                                            type: 'tree',
                                            //model: 'KitchenSink.model.tree.Task',
                                            folderSort: true,
                                            proxy: {
                                                type: 'ajax',
                                                url: '../app/chartoptionstore'
                                            }
                                        }
                                    }

                        ],
                        renderTo: Ext.getBody()
                    });            
                    
        

                }
            });
        </script>

</head>

<body>
</body>

</html>